package org.megha.blog.example.morethreads;

/**
 * Reports a given time to the {@link StatisticsCollector}.
 *
 * @author megha birmiwal
 */
public class TimeReporter implements Runnable {

	private final int timeToReport;
	private final int count;

	public TimeReporter(int timeToReport, int count) {
		this.timeToReport = timeToReport;
		this.count = count;
	}

	@Override
	public void run() {
		for (int i = 0; i < count; i++) {
			StatisticsCollector.STATS.reportStat(timeToReport);
		}
	}
}
